package com.hbnu.sync.service.impl;


import com.hbnu.sync.domain.entity.SyncDept;
import com.hbnu.sync.mapper.SyncDeptMapper;
import com.hbnu.sync.service.ISyncDeptService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jxl
 * @since 2025-08-23
 */
@Service
public class SyncDeptServiceImpl extends ServiceImpl<SyncDeptMapper, SyncDept> implements ISyncDeptService {

    /**
     * 同步所有部门到主服务数据库
     *
     * @return
     */
    @Override
    public List<SyncDept> MoveAllDept() {
        // 查询所有部门数据，排除deptCode字段
        List<SyncDept> syncDeptList = query().select(
            "DeptID", "deptName", "deptName_id"
        ).list();
        return syncDeptList;
    }
}
